import { Public } from '@/decorators/visit.decorator';
import { Controller, Delete, Get, Query } from '@nestjs/common';
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
import { MatchService } from './match.service';

@ApiTags('匹配管理')
@Controller('admin/match')
export class MatchController {
  constructor(private readonly matchService: MatchService) {}

  @Public()
  @ApiOperation({
    summary: '匹配列表查询',
  })
  @ApiBearerAuth()
  @Get('/matchListSelect')
  matchListSelect(@Query('page') page = 1, @Query('size') size = 10) {
    return this.matchService.matchListSelect({
      page: Number(page),
      size: Number(size),
    });
  }

  @Public()
  @ApiOperation({
    summary: '匹配数据删除',
  })
  @ApiBearerAuth()
  @Delete('/deleteMatch')
  deleteMatch(@Query('id') id: number) {
    return this.matchService.deleteMatch(id);
  }
}
